package com.wxdc.nmgyt.nmgytwydc.model;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.ToMany;
import org.greenrobot.greendao.annotation.Unique;

import java.io.Serializable;
import java.util.List;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.DaoException;
import com.wxdc.nmgyt.nmgytwydc.greendao.DaoSession;
import com.wxdc.nmgyt.nmgytwydc.greendao.CbYfWzInfoBeanDao;
import com.wxdc.nmgyt.nmgytwydc.greendao.CbYfInfoBeanDao;

/**
 * Created by Administrator on 2018/7/13.
 * 草本样方(一对多)
 */
@Entity
public class CbYfInfoBean implements Serializable{
    private static final long serialVersionUID = -4541916134465719450L;
    /**
     * SAMPLEPLOTID : 150700-005-2018
     * SAMPLEPLOTNAME : 伊敏苏 木
     * GRASSID : 150700-005-201808-0071- CB-1
     * YFMJ : 0.0
     * ZGD : 0.0
     * PJGD : 0.0
     * SHBZ : 0,0,0
     * VERSION : 1
     * PICNAME :
     * GRASS_WZ :
     */
    @Id(autoincrement = true)
    private Long id; //@Id表示该字段是id，注意该字段的数据类型为包装类型Long
    private String SAMPLEPLOTID;
    private String SAMPLEPLOTNAME;
    private String GRASSID;
    private String YFMJ;
    private String ZGD;
    private String PJGD;
    private String SHBZ;
    private String VERSION;
    private String PICNAME;
    //此处的cbyfInfoId是在CbYfWzInfoBean中定义的一个变量（请看CbYfWzInfoBean.java）
    @ToMany(referencedJoinProperty = "cbyfInfoId")
    private List<CbYfWzInfoBean> GRASS_WZ;

    private String IMGPATH;
    private String YFH;//样方号
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 1111540222)
    private transient CbYfInfoBeanDao myDao;
    @Generated(hash = 246525033)
    public CbYfInfoBean(Long id, String SAMPLEPLOTID, String SAMPLEPLOTNAME,
            String GRASSID, String YFMJ, String ZGD, String PJGD, String SHBZ,
            String VERSION, String PICNAME, String IMGPATH, String YFH) {
        this.id = id;
        this.SAMPLEPLOTID = SAMPLEPLOTID;
        this.SAMPLEPLOTNAME = SAMPLEPLOTNAME;
        this.GRASSID = GRASSID;
        this.YFMJ = YFMJ;
        this.ZGD = ZGD;
        this.PJGD = PJGD;
        this.SHBZ = SHBZ;
        this.VERSION = VERSION;
        this.PICNAME = PICNAME;
        this.IMGPATH = IMGPATH;
        this.YFH = YFH;
    }
    @Generated(hash = 801591127)
    public CbYfInfoBean() {
    }
    public Long getId() {
        return this.id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getSAMPLEPLOTID() {
        return this.SAMPLEPLOTID;
    }
    public void setSAMPLEPLOTID(String SAMPLEPLOTID) {
        this.SAMPLEPLOTID = SAMPLEPLOTID;
    }
    public String getSAMPLEPLOTNAME() {
        return this.SAMPLEPLOTNAME;
    }
    public void setSAMPLEPLOTNAME(String SAMPLEPLOTNAME) {
        this.SAMPLEPLOTNAME = SAMPLEPLOTNAME;
    }
    public String getGRASSID() {
        return this.GRASSID;
    }
    public void setGRASSID(String GRASSID) {
        this.GRASSID = GRASSID;
    }
    public String getYFMJ() {
        return this.YFMJ;
    }
    public void setYFMJ(String YFMJ) {
        this.YFMJ = YFMJ;
    }
    public String getZGD() {
        return this.ZGD;
    }
    public void setZGD(String ZGD) {
        this.ZGD = ZGD;
    }
    public String getPJGD() {
        return this.PJGD;
    }
    public void setPJGD(String PJGD) {
        this.PJGD = PJGD;
    }
    public String getSHBZ() {
        return this.SHBZ;
    }
    public void setSHBZ(String SHBZ) {
        this.SHBZ = SHBZ;
    }
    public String getVERSION() {
        return this.VERSION;
    }
    public void setVERSION(String VERSION) {
        this.VERSION = VERSION;
    }
    public String getPICNAME() {
        return this.PICNAME;
    }
    public void setPICNAME(String PICNAME) {
        this.PICNAME = PICNAME;
    }
    public String getIMGPATH() {
        return this.IMGPATH;
    }
    public void setIMGPATH(String IMGPATH) {
        this.IMGPATH = IMGPATH;
    }
    public String getYFH() {
        return this.YFH;
    }
    public void setYFH(String YFH) {
        this.YFH = YFH;
    }
    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Generated(hash = 957078166)
    public List<CbYfWzInfoBean> getGRASS_WZ() {
        if (GRASS_WZ == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            CbYfWzInfoBeanDao targetDao = daoSession.getCbYfWzInfoBeanDao();
            List<CbYfWzInfoBean> GRASS_WZNew = targetDao
                    ._queryCbYfInfoBean_GRASS_WZ(id);
            synchronized (this) {
                if (GRASS_WZ == null) {
                    GRASS_WZ = GRASS_WZNew;
                }
            }
        }
        return GRASS_WZ;
    }
    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Generated(hash = 1498147322)
    public synchronized void resetGRASS_WZ() {
        GRASS_WZ = null;
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 960152323)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getCbYfInfoBeanDao() : null;
    }

    @Override
    public String toString() {
        return "CbYfInfoBean{" +
                "id=" + id +
                ", SAMPLEPLOTID='" + SAMPLEPLOTID + '\'' +
                ", SAMPLEPLOTNAME='" + SAMPLEPLOTNAME + '\'' +
                ", GRASSID='" + GRASSID + '\'' +
                ", YFMJ='" + YFMJ + '\'' +
                ", ZGD='" + ZGD + '\'' +
                ", PJGD='" + PJGD + '\'' +
                ", SHBZ='" + SHBZ + '\'' +
                ", VERSION='" + VERSION + '\'' +
                ", PICNAME='" + PICNAME + '\'' +
                ", GRASS_WZ=" + GRASS_WZ +
                ", IMGPATH='" + IMGPATH + '\'' +
                ", YFH='" + YFH + '\'' +
                ", daoSession=" + daoSession +
                ", myDao=" + myDao +
                '}';
    }
}
